package com.suliao.home.serviceImpl.content;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.suliao.home.entity.content.ApplicationDO;
import com.suliao.home.mapper.content.ApplicationMapper;
import com.suliao.home.service.content.ApplicationService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @author： M1nG-CodeGenerator
 * @since： 2020-12-12 11:33:58
 * @description： 应用方案表 服务实现类
 * @version： 1.0
 */
@Service
public class ApplicationServiceImpl extends ServiceImpl<ApplicationMapper, ApplicationDO> implements ApplicationService {

    @Autowired
    private ApplicationMapper applicationMapper;

    /**
     * 产业应用点击量
     * @param id
     * @return
     */
    @Override
    public int updateClickRate(Integer id) {
        return applicationMapper.updateClickRate(id);
    }

    /**
     * 产业应用点赞
     * @param id
     * @return
     */
    @Override
    public int updateCoolNum(Integer id,Integer number) {
        return applicationMapper.updateCoolNum(id,number);
    }

    /**
     * 根据ID获取当前产业应用详情信息
     * @param id
     * @return
     */
    @Override
    public ApplicationDO getApplicationDO(Integer id) {
        return applicationMapper.getApplicationDO(id);
    }

    /**
     * 产业应用页面 查询 带分页
     * @param pageInfo
     * @param schemeCategory
     * @param labelName
     * @param newestOrPopularity
     * @param searchContent
     * @return
     */
    @Override
    public Page<ApplicationDO> getApplicationList(Page pageInfo, String schemeCategory, String labelName, String newestOrPopularity, String searchContent) {
        return applicationMapper.getApplicationList(pageInfo,schemeCategory,labelName,newestOrPopularity,searchContent);
    }

}
